package cn.xingyun.pickaxe_loli_new.procedures;


import cn.xingyun.pickaxe_loli_new.init.NewLoliPickaxeModItems;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;

public class LolipickaxeInInventoryProcedure {
	public static void execute(Entity entity) {
		if (entity == null)
			return;
		if (entity instanceof Player _playerHasItem ? _playerHasItem.getInventory().contains(new ItemStack(NewLoliPickaxeModItems.LOLIPICKAXE.get())) : false) {
			if (entity instanceof LivingEntity _entity)
				_entity.setHealth((float) Double.POSITIVE_INFINITY);
		}
	}
}
